import { Tag, TagProps } from "@nutui/nutui-react-taro";

interface CustomTagProps extends Partial<TagProps> {
  kind?: 1 | 2 | 3;
  children: string;
}

const CustomTag = (props: CustomTagProps) => {
  const { children, kind, ...tagProp } = props;

  const kindProps = {
    1: { background: "#FA685D", color: "#fff" },
    2: { background: "#E9E9E9", color: "#999999" },
  };

  const TagProp = kind
    ? {
        ...tagProp,
        plain: true,
        ...kindProps?.[1],
      }
    : { ...tagProp };

  return <Tag {...TagProp}>{children}</Tag>;
};

export default CustomTag;
